//
// Created by Administrator on 2024/3/25.
//
#include<bits/stdc++.h>

using namespace std;
typedef long long ll;
const int maxn = 1e6 + 100;
ll dp[maxn];//dp[i]  i元的最优找零张数
int main() {
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++) dp[i] = i;//存在1元所以i元一定可以用i个1元组合
    dp[1] = dp[2] = dp[4] = dp[5] = dp[10] = 1;//货币单位可以用1张

    for (int i = 3; i <= n; i++) {
        if (i >= 1)dp[i] = min(dp[i], 1 + dp[i - 1]);
        if (i >= 2)dp[i] = min(dp[i], 1 + dp[i - 2]);
        if (i >= 4)dp[i] = min(dp[i], 1 + dp[i - 4]);
        if (i >= 5)dp[i] = min(dp[i], 1 + dp[i - 5]);
        if (i >= 10)dp[i] = min(dp[i], 1 + dp[i - 10]);
    }

    cout << dp[n];

    return 0;
}